﻿namespace Quail
{
    public class EmptyPage : IWebPage
    {
        private readonly EmptyBrowser _browser;
        public EmptyPage(EmptyBrowser browser)
        {
            _browser = browser;
        }

        /// <summary>
        /// Called when the Sync() method completes successfully
        /// </summary>
        public event OnWebPageCompleteEvent OnSyncIsCompleteEvent;

        /// <summary>
        /// Called when the Sync() method fails
        /// </summary>
        public event OnFailedEvent OnSyncFailedEvent;

        public string Location
        {
            get { return string.Empty; }
        }

        public string SafeLocation
        {
            get { return Location; }
        }

        public void Sync(YSODCheckTypes ysod)
        {
            if (OnSyncIsCompleteEvent != null)
                OnSyncIsCompleteEvent(this);
        }

        public void SyncAnyPage(YSODCheckTypes ysod)
        {
            if (OnSyncIsCompleteEvent != null)
                OnSyncIsCompleteEvent(this);
        }

        public Task ActiveTask
        {
            get { return _browser.ActiveTask; }
        }

        public bool Exists
        {
            get { return true; }
        }

        public string Html
        {
            get
            {
                return string.Empty;
            }
        }
    }
}
